package com.example.demo0

import com.example.util.p


fun breaststroke(){
    p("breaststroke")
}

fun backstroke(){
    p("backstroke")
}

fun freestyle(){
    p("freestyle")
}


class Swimmer2(val swimming:()->Unit){
    fun swim(){
       swimming()
    }
}



fun main(){

    val weekendShaw = Swimmer2(::freestyle)
    weekendShaw.swim()

    val weekdaysShaw = Swimmer2(::breaststroke)
    weekdaysShaw.swim()


}




